//
//  ReForgetPwdVC.m
//  WalletAPP
//
//  Created by 罗弟祥 on 2019/10/12.
//  Copyright © 2019 罗弟祥. All rights reserved.
//

#import "ReForgetPwdVC.h"
#import "AffirmForgetPwdVC.h"
@interface ReForgetPwdVC ()
@property (weak, nonatomic) IBOutlet UITextField *codeTF;
@property (weak, nonatomic) IBOutlet UIButton *nextBtn;

@property (nonatomic, retain) RefreshVM *vm;
@end

@implementation ReForgetPwdVC

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
}
- (IBAction)backBtnClick:(UIButton *)sender {
    [self.navigationController popViewControllerAnimated:YES];
}
- (IBAction)nextBtnClick:(UIButton *)sender {
    if (self.codeTF.text.length < 1) {
        [SVProgressHUD showErrorWithStatus:@"请输入验证码"];
        return;
    }
    [self checkVerbCodeRequest];
}


-(void)checkVerbCodeRequest{
    self.vm = [RefreshVM new];
    self.vm.urlStr = @"/api/password/code";
    self.vm.params = @{@"code":self.codeTF.text,@"acount":self.email};
    
    [self.vm requestDataNormal];
    [self.vm setRequestResultBlock:^(id obj) {
        
        AffirmForgetPwdVC *vc = [AffirmForgetPwdVC new];
        vc.code = self.codeTF.text;
        vc.email = self.email;
        [self.navigationController pushViewController:vc animated:YES];
        
    }];
}


/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
